package com.pyf.demo.service.impl;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * @author pengyifeng
 * @version 1.0.0
 * @ClassName MyScheduled.java
 * @Description TODO
 * @createTime 2020年12月09日 18:00:00
 */
@Service
public class MyScheduled {

    @Scheduled(cron = "0/2 * * * * 0-7")
    public void task(){
        System.out.println("定时任务开始:"+ LocalDateTime.now().getSecond()+"秒");
    }
}
